using System;
using Gtk;
using System.Data;

public partial class MainWindow : Gtk.Window
{
	public MainWindow () : base(Gtk.WindowType.Toplevel)
	{
		//mottai
		Build ();
		fillcombodata(ref comboboxentry1,(new databaselib.database_loading()).listdata(),"name");
		//DataTable dt=new databaselib.database_loading().listdata();
		//foreach(DataRow dr in dt)
		//comboboxentry1.Data.Add("name",dr["name"].ToString());
		//MenuItem company=new MenuItem("select company");
		//company.Add(new databaselib.database_loading().listdata() );
		//comboboxentry1.Add(new databaselib.database_loading().listdata());
	}
	private void fillcombodata(ref ComboBoxEntry comboboxentry1,DataTable dt,string colname)
{
for(int i=0;i<dt.Rows.Count;i++)
{
if(i==0)
comboboxentry1.Entry.Text=dt.Rows[i][colname].ToString();
comboboxentry1.InsertText(i,dt.Rows[i][colname].ToString());
}
}
	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}
	protected virtual void OnQuitAction1Activated (object sender, System.EventArgs e)
	{
		Application.Quit();
	}
	protected virtual void OnCreateCompanyAction1Activated (object sender, System.EventArgs e)
	{
		account_every_penny.frmcmpny a=new account_every_penny.frmcmpny();
		a.Show();		
	}	
	
}

